//
//  UserBSModifyUserInfo.m
//  Teacher
//
//  Created by 李飞 on 15/10/29.
//  Copyright (c) 2015年 xueyinyue. All rights reserved.
//

#import "UserBSModifyUserInfo.h"
#import "ApiConfig.h"
#import "ApplicationContext.h"

@implementation UserBSModifyUserInfo


- (id)onExecute
{
    NSDictionary *params;
    if (_instrument)
    {
        params = @{@"token":[ApplicationContext instance].token,@"photoUrl":_photoUrl,@"userName":_userName,@"sex":_sex,@"instrument":_instrument,@"schoolage":_schoolage,@"introduce":_introduce,@"versionCode":kVersionCode,@"systemType":kSystemType};
    }
    else
    {
        params = @{@"token":[ApplicationContext instance].token,@"photoUrl":_photoUrl,@"userName":_userName,@"sex":_sex,@"schoolage":_schoolage,@"introduce":_introduce,@"versionCode":kVersionCode,@"systemType":kSystemType};
    }
    
    id result = [self remoteJSON:@"POST" url:[ApiConfig urlApiModifyUserInfo] params:params];
    
    UserBSModifyUserInfoResult *serviceResult = [[UserBSModifyUserInfoResult alloc] init];
    
    NSNumber *returnState = result[@"error"];
    
    if ([returnState isEqualToNumber:@0]) {
        serviceResult.isSuccess = YES;
    }
    else
    {
        serviceResult.isSuccess = NO;
    }
    serviceResult.message = result[@"msg"];
    
    return serviceResult;
}

@end

@implementation UserBSModifyUserInfoResult

@end